package com.syni.mdd.yhd.common.all.dao.jpa;

import com.syni.mdd.yhd.common.all.dao.BaseJPADao;
import com.syni.mdd.yhd.common.all.entity.BmsBusiness;
import com.syni.mdd.yhd.common.all.entity.BmsDxAnswer;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface BmsDxAnswerDao extends BaseJPADao<BmsDxAnswer,Integer> {

    List<BmsDxAnswer> findByBmsDxCommentIdIn(Set<Integer> commentIds);

    @Query(value="select bda.bms_dx_comment_id,count(bda.id) num from bms_dx_answer bda where bda.bms_dx_comment_id in (?1) group by bda.bms_dx_comment_id",nativeQuery=true)
    List<Map<String,Object>> countVideoAnswerNum(Set commentIds);
}
